WITH RunLog AS( select [ADF Run GUID], MIN(PipelineStart) as startDate,MAX(PipelineFinish) as endDate from LSInsightAudit WHERE [ADF Pipeline Name] = 'All staging Tables' group by [ADF Run GUID]), OverLap AS ( select R1.[ADF Run GUID] as RunID1, R2.[ADF Run GUID] as RunID2, R1.[startDate] as R1StartDate, R2.[startDate] as R2StartDate, R1.[endDate] as R1EndDate, R2.[endDate] as R2EndDate, case when (R1.startDate between R2.startDate and R2.endDate) or (R1.endDate between R2.startDate and R2.endDate) or (R1.startDate < R2.startDate and R1.endDate > R2.endDate) or (R1.startDate > R2.startDate and R1.endDate < R2.endDate) then 'yes' else 'no' end as OverLapping from RunLog R1, RunLog R2 WHERE R1.[ADF Run GUID] <> R2.[ADF Run GUID]) Select * from OverLap where OverLapping = 'yes'